/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2019-11-1
*
\*********************************************************************/

#ifndef UTILS_VPU_H
#define UTILS_VPU_H

#include "vpu_lib.h"
#include "vpu_io.h"

int vpu_test_dbg_level;

#define dprintf(level, fmt, arg...)     if (vpu_test_dbg_level >= level) \
        printf("[DEBUG]\t%s:%d " fmt, __FILE__, __LINE__, ## arg)

#define err_msg(fmt, arg...) do { if (vpu_test_dbg_level >= 1)		\
    printf("[ERR]\t%s:%d " fmt,  __FILE__, __LINE__, ## arg); else \
    printf("[ERR]\t" fmt, ## arg);	\
    } while (0)
#define info_msg(fmt, arg...) do { if (vpu_test_dbg_level >= 1)		\
    printf("[INFO]\t%s:%d " fmt,  __FILE__, __LINE__, ## arg); else \
    printf("[INFO]\t" fmt, ## arg);	\
    } while (0)
#define warn_msg(fmt, arg...) do { if (vpu_test_dbg_level >= 1)		\
    printf("[WARN]\t%s:%d " fmt,  __FILE__, __LINE__, ## arg); else \
    printf("[WARN]\t" fmt, ## arg);	\
    } while (0)


//typedef unsigned long u32_vpu;
//typedef unsigned short u16_vpu;
//typedef unsigned char u8_vpu;
//typedef long s32_vpu;
//typedef short s16_vpu;
//typedef char s8_vpu;

enum {
    MODE420 = 0,
    MODE422 = 1,
    MODE224 = 2,
    MODE444 = 3,
    MODE400 = 4
};

struct frame_buf {
    int addrY;
    int addrCb;
    int addrCr;
    int strideY;
    int strideC;
    int mvColBuf;
    vpu_mem_desc desc;
};

#define MAX_PATH	256

struct cmd_line {
    char output[MAX_PATH];  /* Output file name */
    int dst_fd;
    int width;
    int height;
    int enc_width;
    int enc_height;
    int format;
    int deblock_en;
    int rot_en; /* Use VPU to do rotation */
    int rot_angle;
    int mirror;
    int chromaInterleave;
    int bitrate;
    int gop;
    int save_enc_hdr;
    int count;
    int mp4_h264Class;
    int fps;
    int mapType;
};

#endif // UTILS_VPU_H

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/
